<!DOCTYPE html>
<!-- saved from url=(0043)https://v3.bootcss.com/examples/dashboard/# -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>首页</title>

    <!-- Bootstrap core CSS -->
    <link href="/res/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/res/dashboard.css" rel="stylesheet">

</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">blog</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">

            </ul>

        </div>
    </div>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li ><a href="/home">首页 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a href="#">博客文章管理</a></li>
            </ul>
            </ul>
        </div>
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">Dashboard</h1>

            <div class="table-responsive">
                <div class="row">
                    <ul class="nav navbar-nav">
                        <li class="active"><a href="/article/create">点击新增</a></li>
                    </ul>
                </div>

                <div class="row col-12">
                    <form method="get">
                    <div class="col-12">
                        <div class="box">
                            <div class="box-header">
                                <div class="form-inline col-12" id="searchDiv">
                                    <div class="form-inline col-8">
                                        @if(\Illuminate\Support\Facades\Auth::user()->is_admin)<div class="btn-group">
                                            <label class="btn" for="author_id">作者:</label>
                                            <select name="author_id" id="author_id" class="form-control select2 ml-10" style="width: 150px" data-placeholder="请选择作者" data-blank="true">
                                                <option value="">请选择作者</option>
                                                @foreach($userList as $v)
                                                    <option value="{{$v->id}}" @if($v->id == $list['where']['author_id']) selected="selected"@endif>{{$v->name}}</option>
                                                @endforeach
                                            </select>
                                        </div>
                                        @endif

                                        <div class="btn-group">
                                            <label class="btn" for="title">标题:</label>
                                            <input placeholder="标题" name="title" class="form-control" type="search" likeOption="false" value="{{$list['where']['title']}}" />
                                        </div>

                                        <div class="btn-group">
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i>发布时间</span>
                                                <input type="search" placeholder="发布时间" title="发布时间" name="start_time" data-flag="datepicker" class="form-control" data-format="yyyy-mm-dd" value="{{$list['where']['start_time']}}">
                                            </div>
                                            ~
                                            <div class="input-group">
                                                <span class="input-group-addon"><i class="fa fa-calendar"></i>发布时间</span>
                                                <input type="search" placeholder="发布时间" title="发布时间" name="end_time" data-flag="datepicker" class="form-control" data-format="yyyy-mm-dd" value="{{$list['where']['end_time']}}">
                                            </div>
                                        </div>

                                        <div class="btn-group">
                                            <input  class="form-control btn btn-success" type="submit" value="查询" />
                                        </div>
                                    </div>


                                </div>
                            </div>


                        </div>
                    </div>
                    </form>
                </div>

                <table class="table table-striped">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>标题</th>
                        <th>简介</th>
                        <th>状态</th>
                        <th>作者</th>
                        <th>最新发布时间</th>
                        <th>创建时间</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                        @foreach($list['list'] as $item)
                            <tr>
                                <td>{{$item->id}}</td>
                                <td>{{$item->title}}</td>
                                <td>{{$item->intro}}</td>
                                <td>{{$item->status}}</td>
                                <td>{{$item->author_id}}</td>
                                <td>{{$item->pub_time}}</td>
                                <td>{{$item->created_at}}</td>
                                <td><a class="btn btn-default" href="article/{{$item->id}}/edit">编辑</a><a class="btn btn-danger" href="article/{{$item->id}}">查看</a></td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

<script src="/res/jquery.min.js"></script>
<script src="/res/bootstrap.min.js"></script>

</body></html>